<?php
class Login_Data_Login {
	
	public $form;
	
	public function __construct(){
		
		$this->form = new Core_Driver_Firstform();
		
	}
	
	public function getData(){
		$data = array();
		$data['form'] = $this->createForm();
		return $data;
	}
	
	private function createForm(){
		
		$loginForm = $this->form->startForm(
			array(
			"method" => "POST",
					"action" => SERVER_ROOT . "?login&page=logged",
					"name" => "login", 
					"id" => "login"
		)
		);
		$loginForm .= $this->form->inputForm(
			array(
			"type" => "hidden",
					"name" => "userLogin",
					"value" => "true"
		),
				null
		);
		$loginForm .= LOGIN_MESSAGE;
		$loginForm .= "<ul>";
		$loginForm .= "<li>";
		$loginForm .= $this->form->labelForm(
			array(
			"for" => "name",
					"id" => "loginLabel"
		),
				LOGIN_LABEL,
				null
		);
		$loginForm .= $this->form->inputForm(
			array(
			"type" => "text",
					"name" => "name",
					"id" => "name",
					"placeholder" => LOGIN_PLACEHOLDER,
					"maxlength" => "20"
		),
				"required autofocus"
		);
		$loginForm .= "</li>";
		$loginForm .= "<li>";
		$loginForm .= $this->form->labelForm(
			array(
			"for" => "password",
					"id" => "passwordLabel"
		),
				PASSWORD_LABEL,
				null
		);
		$loginForm .= $this->form->inputForm(
			array(
			"name" => "password",
					"id" => "password",
					"type" => "password",
					"placeholder" => PASSWORD_PLACEHOLDER,
					"maxlength" => "20"
		),
				"required"
		);
		$loginForm .= "</li>";
		$loginForm .= "</ul>";
		$loginForm .= '<div class="buttons">';
		$loginForm .= $this->form->inputForm(
			array(
			"name" => "submit",
					"type" => "submit",
					"value" => LOGIN_BUTTON,
					"id" => "submit"
		),
				null
		);
		$loginForm .= "</div>";
		$loginForm .= $this->form->endForm();
		return $loginForm;
		
	}
	
}